package model;

import org.omg.CORBA.MARSHAL;

import java.util.Random;

/**
 * Created by alex on 11/10/2016.
 */
public class FullConnectLayer extends Layer{


    public FullConnectLayer(int finIn, int finOut) {
        super(finIn, finOut);
    }

    public double[] output(double[] input){
        if (input.length!=finIn){
            System.out.println("input length is wrong");
        }

        double [] out = new double[finOut];
        for(int i  = 0;i<finOut;i++){
            out[i]=0;
            for (int j = 0;j<finIn;j++){
                out[i]+=W[i][j]*input[j];
            }
            out[i]+=b[i];
            out[i] = sigmoid(out[i]);
        }
        return out;
    }
}
